package com.inphase;

import com.inphase.test.tables.SysOss;
import com.inphase.test.tables.daos.SysOssDao;
import com.inphase.test.tables.records.SysOssRecord;
import org.jooq.DSLContext;
import org.jooq.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@SpringBootApplication
@RestController
public class JooqApplication {

    @Autowired
    DSLContext context;


    @Autowired
    SysOssDao sysOssDao;


    @RequestMapping("/")
    public List<com.inphase.test.tables.pojos.SysOss> hi(){


        Result<SysOssRecord> rs = context.selectFrom(SysOss.SYS_OSS)
                .limit(0,2).fetch();





        return  rs.into(com.inphase.test.tables.pojos.SysOss.class);
    }


    public static void main(String[] args) {
        SpringApplication.run(JooqApplication.class,args);
    }
}
